/**
 * 插件地址：https://github.com/skyvow/wx-extend
 * 验证插件: https://github.com/skyvow/wx-extend/blob/master/docs/components/validate.md
 * 教程：https://www.cnblogs.com/cisum/p/9556736.html
 */
import WxValidate from "../../../plugs/wx-validate/WxValidate.js";

module.exports.createInstance = function (){
    const rules = {
        name: {
          required: true
        },
        phone: {
          required: true,
          tel: true
        },
        company: {
          required: true
        }
      };
    // 验证字段的提示信息，若不传则调用默认的信息
    const messages = {
        name: {
          required: '请输入姓名'
        },
        phone: {
          required: '请输入手机号',
          tel: '请输入正确的手机号'
        },
        company: {
          required: '请输入公司名称'
        }
      };
    //
    return new WxValidate(rules, messages)
  };
